﻿using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DataType;
using Google.GData.Client;
using Google.Contacts;
using Google.Documents; 

namespace LocalView
{


    public abstract class ILocalView
    {
        public delegate void VoidDelegate();
        public VoidDelegate m_startProgress;
        public VoidDelegate m_stopProgress;
        public Credentials m_Cred; 
        public enum Permission { reader, writer };
        public enum CollisionWinner { local, server };
        public DocumentInfo m_DocInfo;

        public virtual event EventHandler<Credentials>              Login;
        public virtual event EventHandler<FeedWrapper<Contact>>     GetContacts;
        public virtual event EventHandler<FeedWrapper<Document>>    GetDocuments;
        public virtual event EventHandler<DocumentInfo>             UploadDocument;
        public virtual event EventHandler<DocumentInfo>             UpdateDocument;
        public virtual event EventHandler<FeedWrapper<Document>>    GetFolders;
        public virtual event EventHandler<DownloadInfo>             DownloadDocument;
        public virtual event EventHandler<ShareInfoCollection>      ShareDocument;
        public virtual event EventHandler<ShareInfoCollection>      GetDocumentAcl;
        public virtual event EventHandler<DocumentInfo>             LookForDocument;
        public virtual event EventHandler<DocumentInfo>             OpenDocumentInCloud;
        public virtual event EventHandler<ContactInfo> AddContact;

        abstract public void DoAddContact(ContactInfo contact); 
        abstract public void DoGetContacts(FeedWrapper<Contact> feed);
        abstract public void DoGetDocuments(FeedWrapper<Document> feed);
        abstract public void DoLogin(Credentials cred);
        abstract public void DoShareDocumentsAsync(IEnumerable users, Permission perm);
        abstract public void DoLookupRemoteCopy(DocumentInfo info);
        abstract public void DoSaveDocumentInCloud();
        abstract public void DoGetDocumentAcl(ShareInfoCollection info);
        abstract public string GetInviteUri();
        abstract public void DoDownloadDocument(DownloadInfo info);
        abstract public void DoOpenLocalCopy(string filePath);
        abstract public void DoOpenDocumentInCloud(DocumentInfo info);
        abstract public void DoUpdateDocument();
        abstract public bool IsDocumentOpened(string path);

        abstract public string GetDocumentPath();
        abstract public string GetDocumentName();
        abstract public void CloseDocument(string path);
        abstract public void ActivateDocument(string path);
        abstract public void Merge(Document dt, ILocalView.CollisionWinner winner);
        abstract public void UpdateDocumentInfo();

        abstract public string SupportedFormats();
        abstract public Document.DocumentType DocumentType();
        abstract public Document.DownloadType DownloadType();
        abstract public string GetContentText();
        abstract public void SmartTagActions(Object tag);
        abstract public void HighlightSmartTags(string word);
        abstract public bool IsLoggedIn();
        abstract public void CastContentToExtension(string docPath, Document.DownloadType type);

        abstract public void InsertSearchResult(string[] result); 
    }
}